type MyQueue struct {
    StackIn   []int
    StackOut  []int
}


func Constructor() MyQueue {
    return MyQueue{
        StackIn:  make([]int, 0),
        StackOut: make([]int, 0),
    }
}


func (this *MyQueue) Push(x int)  {
    this.StackIn = append(this.StackIn, x)
}


func (this *MyQueue) Pop() int {
    if len(this.StackOut)  > 0 {
        val := this.StackOut[len(this.StackOut)-1]
        this.StackOut = this.StackOut[:len(this.StackOut)-1]
        return val
    }

    if this.Empty() {
        return 0
    }

    for len(this.StackIn) > 0 {
        val := this.StackIn[len(this.StackIn)-1]
        this.StackIn = this.StackIn[:len(this.StackIn)-1]
        this.StackOut = append(this.StackOut, val)
    }
    val := this.StackOut[len(this.StackOut)-1]
    this.StackOut = this.StackOut[:len(this.StackOut)-1]
    return val
}


func (this *MyQueue) Peek() int {
    if len(this.StackOut) > 0 {
        return this.StackOut[len(this.StackOut)-1]
    }
    
    if this.Empty() {
        return 0
    }

    return this.StackIn[0]
}


func (this *MyQueue) Empty() bool {
    return len(this.StackOut) == 0 && len(this.StackIn) == 0
}


/**
 * Your MyQueue object will be instantiated and called as such:
 * obj := Constructor();
 * obj.Push(x);
 * param_2 := obj.Pop();
 * param_3 := obj.Peek();
 * param_4 := obj.Empty();
 */